import React from 'react';
import {Link} from 'react-router-dom';
import { Button } from 'antd/lib/radio';

import '../css/reg.css'
import UserService from '../service/user';

const service = new UserService();

export default class Reg extends React.Component {
    render () {
        return (
        <_Reg service={service} />
        )
    }
}

class _Reg extends React.Component {

    handleClick(event) {
        event.preventDefault();
        console.log(event.target);
        let fm = event.target.form;
        // console.log(1);
        console.log("~~~~~~~~~~~~~~~");
        let ret = this.props.service.login(fm[0].value, fm[1].value)
    } 

    render = () =>
        (<div className="reg-page">
            <div className="form">
                <form className="reg-form">
                    <input type="text" placeholder="姓名" /> 
                    <input type="text" placeholder="邮箱" /> 
                    <input type="password" placeholder="密码" />
                    <input type="password" placeholder="确认密码" />

                    <button >注册</button>
                    <p className="message">已注册?<Link to="/login"> 请登录.</Link></p>
                </form>
            </div>Í
        </div>);
}